/* 
 *"加入我们页"逻辑代码
 * 2015.5.13---JackYan
 * */
	var joinImg = "img/join/joinUS.png";
	var joinXSImg = "img/mobile/join/joinUS.jpg";

var joinVM=avalon.define({
	$id:"joinController",
	vmJoinImg:joinImg,
	selectIndex:0,
	toggle:function(index){
		joinVM.selectIndex=index;
		$("#joinTab>a").eq(index).css("background-color","#F5F5F5").siblings().css("background-color","");		
	},
	itemImgClick:function(imgItem){
		$(imgItem).next().slideToggle();
	}
});

//初始化事件的监听
joinVM.$watch("init", function(v) {
	avalon.log(v);
	joinVM.selectIndex=0;
});
	
	//设置大图
	function setJumbotronImg(){
		var width = document.body.clientWidth;
		if(width < 768){
			joinVM.vmJoinImg = joinXSImg;
		}
		else{
			joinVM.vmJoinImg = joinImg;
		}
	}
	setJumbotronImg();
	//监听屏幕尺寸
	joinVM.$watch('resize',function(){
		setJumbotronImg();
	});

avalon.scan();